package com.lzh.controller;

import com.lzh.pojo.resp.BaseResp;
import com.lzh.pojo.resp.NoticeResp;
import com.lzh.service.NoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author Li
 * @ 2022/3/29
 */
@RestController
@RequestMapping("/notice")
@CrossOrigin
public class NoticeController {

    @Autowired(required = false)
    NoticeService noticeService ;

    @RequestMapping("/findNotices")
    public BaseResp findByPage(@RequestBody Map map){
        return noticeService.find(map) ;
    }

    @RequestMapping("/findByName/{id}")
    public BaseResp findByName(@PathVariable("id") String id){
        return noticeService.findByName(id) ;
    }
}
